﻿#region Using Directives

using GalaSoft.MvvmLight;

#endregion

namespace Scripni.Chess.UI.ViewModels
{
    /// <summary>
    /// Encapsulates a chess game.
    /// </summary>
    public class GameViewModel : ViewModelBase
    {
        #region Constructors

        /// <summary>
        /// Creates a new instance of the <see cref="GameViewModel"/> class.
        /// </summary>
        public GameViewModel()
        {
            Board = new BoardViewModel(BoardInitializationMode.InitialPosition);
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the current game board.
        /// </summary>
        public BoardViewModel Board
        {
            get
            {
                return this.board;
            }
            set
            {
                this.board = value;
                RaisePropertyChanged(() => Board);
            }
        }

        private BoardSquareViewModel activeSquare;

        /// <summary>
        /// Gets or sets the currently active square on the board.
        /// </summary>
        public BoardSquareViewModel ActiveSquare
        {
            get
            {
                return this.activeSquare;
            }
            set
            {
                this.activeSquare = value;
            }
        }


        #endregion

        #region Constants and Fields

        private BoardViewModel board;

        #endregion
    }
}